
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>go的mysql操作 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="go的api接口实现.html" />
    
    
    <link rel="prev" href="mysql表设计.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="./">
            
                <a href="./">
            
                    
                    Part2 模拟商城
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="payflow.html">
            
                <a href="payflow.html">
            
                    
                    订单支付流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="goinstall.html">
            
                <a href="goinstall.html">
            
                    
                    go 语言环境安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.3" data-path="gomod.html">
            
                <a href="gomod.html">
            
                    
                    包管理工具 go mod
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.4" data-path="http.html">
            
                <a href="http.html">
            
                    
                    实现http服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.5" data-path="http静态资源服务器.html">
            
                <a href="http静态资源服务器.html">
            
                    
                    http静态资源服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.6" data-path="mysql表设计.html">
            
                <a href="mysql表设计.html">
            
                    
                    mysql表设计
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.7" data-path="go的mysql操作.html">
            
                <a href="go的mysql操作.html">
            
                    
                    go的mysql操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.8" data-path="go的api接口实现.html">
            
                <a href="go的api接口实现.html">
            
                    
                    go的api接口实现
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../alipay/">
            
                <a href="../alipay/">
            
                    
                    Part3 接入支付宝
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="../alipay/flow.html">
            
                <a href="../alipay/flow.html">
            
                    
                    支付宝文档
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="../alipay/secret.html">
            
                <a href="../alipay/secret.html">
            
                    
                    密码学-非对称加密
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    
        
        <li class="header">扩展</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../plugins.md">
            
                <span>
            
                    
                    插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="../themes.md">
            
                <span>
            
                    
                    主题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="../bookjson.md">
            
                <span>
            
                    
                    bookjson
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >go的mysql操作</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="go&#x7684;mysql&#x64CD;&#x4F5C;">go&#x7684;mysql&#x64CD;&#x4F5C;</h2>
<p>go&#x8BED;&#x8A00;&#x7684;&#x6807;&#x51C6;&#x5E93;&#x4E5F;&#x63D0;&#x4F9B;&#x4E86;&#x8BBF;&#x95EE;&#x5173;&#x7CFB;&#x578B;&#x6570;&#x636E;&#x5E93;&#x7684;&#x63A5;&#x53E3; database/sql, &#x8FD9;&#x662F;&#x5178;&#x578B;&#x7684;&#x6865;&#x63A5;&#x6A21;&#x5F0F;&#x7684;&#x5B9E;&#x73B0;&#x3002;<br>
sql&#x5305;&#x503C;&#x63D0;&#x4F9B;&#x4E86;sql&#x6570;&#x636E;&#x5E93;&#x7684;&#x6CDB;&#x7528;&#x63A5;&#x53E3;&#xFF0C;&#x5B9E;&#x9645;&#x4F7F;&#x7528;sql&#x5305;&#x7684;&#x65F6;&#x5019;&#x8FD8;&#x5F97;&#x6CE8;&#x5165;&#x4E00;&#x4E2A;&#x6570;&#x636E;&#x5E93;&#x7684;&#x9A71;&#x52A8;&#x7A0B;&#x5E8F;&#xFF0C;mysql&#x7684;&#x5E38;&#x7528;&#x9A71;&#x52A8;&#x7A0B;&#x5E8F;&#x662F;</p>
<pre><code>github.com/go-sql-driver/mysql
</code></pre><p>sql.DB&#x4E3A;&#x4F60;&#x5728;&#x5E55;&#x540E;&#x6267;&#x884C;&#x4E00;&#x4E9B;&#x91CD;&#x8981;&#x7684;&#x4EFB;&#x52A1;:</p>
<ul>
<li>&#x901A;&#x8FC7;&#x9A71;&#x52A8;&#x7A0B;&#x5E8F;&#x6253;&#x5F00;&#x548C;&#x5173;&#x95ED;&#x5B9E;&#x9645;&#x7684;&#x5E95;&#x5C42;&#x6570;&#x636E;&#x5E93;&#x7684;&#x8FDE;&#x63A5;&#x3002;</li>
<li>&#x5B83;&#x6839;&#x636E;&#x9700;&#x8981;&#x7BA1;&#x7406;&#x4E00;&#x4E2A;&#x8FDE;&#x63A5;&#x6C60;&#xFF0C;&#x8FD9;&#x53EF;&#x80FD;&#x662F;&#x5982;&#x4E0A;&#x6240;&#x8FF0;&#x7684;&#x5404;&#x79CD;&#x5404;&#x6837;&#x7684;&#x4E8B;&#x60C5;&#x3002;</li>
</ul>
<p>sql.DB&#x62BD;&#x8C61;&#x65E8;&#x5728;&#x8BA9;&#x4F60;&#x4E0D;&#x5FC5;&#x62C5;&#x5FC3;&#x5982;&#x4F55;&#x7BA1;&#x7406;&#x5BF9;&#x57FA;&#x7840;&#x6570;&#x636E;&#x5B58;&#x50A8;&#x7684;&#x5E76;&#x53D1;&#x8BBF;&#x95EE;&#x3002;&#x4E00;&#x4E2A;&#x8FDE;&#x63A5;&#x5728;&#x4F7F;&#x7528;&#x5B83;&#x6267;&#x884C;&#x4EFB;&#x52A1;&#x65F6;&#x88AB;&#x6807;&#x8BB0;&#x4E3A;&#x53EF;&#x7528;&#xFF0C;&#x7136;&#x540E;&#x5F53;&#x5B83;&#x4E0D;&#x5728;&#x4F7F;&#x7528;&#x65F6;&#x8FD4;&#x56DE;&#x5230;&#x53EF;&#x7528;&#x7684;&#x6C60;&#x4E2D;&#x3002;&#x8FD9;&#x6837;&#x7684;&#x540E;&#x679C;&#x4E4B;&#x4E00;&#x662F;&#xFF0C;&#x5982;&#x679C;&#x4F60;&#x65E0;&#x6CD5;&#x5C06;&#x8FDE;&#x63A5;&#x91CA;&#x653E;&#x5230;&#x6C60;&#x4E2D;&#xFF0C;&#x5219;&#x53EF;&#x80FD;&#x5BFC;&#x81F4;db.SQL&#x6253;&#x5F00;&#x5927;&#x91CF;&#x8FDE;&#x63A5;&#xFF0C;&#x53EF;&#x80FD;&#x4F1A;&#x8017;&#x5C3D;&#x8D44;&#x6E90;(&#x8FDE;&#x63A5;&#x592A;&#x591A;&#xFF0C;&#x6253;&#x5F00;&#x7684;&#x6587;&#x4EF6;&#x53E5;&#x67C4;&#x592A;&#x591A;&#xFF0C;&#x7F3A;&#x5C11;&#x53EF;&#x7528;&#x7F51;&#x7EDC;&#x7AEF;&#x53E3;&#x7B49;)&#x3002;&#x7A0D;&#x540E;&#x6211;&#x4EEC;&#x5C06;&#x8FDB;&#x4E00;&#x6B65;&#x8BA8;&#x8BBA;&#x8FD9;&#x4E2A;&#x95EE;&#x9898;&#x3002;&#x5728;&#x521B;&#x5EFA;sql.DB&#x4E4B;&#x540E;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x7528;&#x5B83;&#x6765;&#x67E5;&#x8BE2;&#x5B83;&#x6240;&#x4EE3;&#x8868;&#x7684;&#x6570;&#x636E;&#x5E93;&#xFF0C;&#x4EE5;&#x53CA;&#x521B;&#x5EFA;&#x8BED;&#x53E5;&#x548C;&#x4E8B;&#x52A1;&#x3002;</p>
<p>&#x53C2;&#x8003;&#xFF1A;
<a href="https://astaxie.gitbooks.io/build-web-application-with-golang/zh/05.1.html" target="_blank">https://astaxie.gitbooks.io/build-web-application-with-golang/zh/05.1.html</a></p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="mysql表设计.html" class="navigation navigation-prev " aria-label="Previous page: mysql表设计">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="go的api接口实现.html" class="navigation navigation-next " aria-label="Next page: go的api接口实现">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"go的mysql操作","level":"1.2.7","depth":2,"next":{"title":"go的api接口实现","level":"1.2.8","depth":2,"path":"two_shop/go的api接口实现.md","ref":"two_shop/go的api接口实现.md","articles":[]},"previous":{"title":"mysql表设计","level":"1.2.6","depth":2,"path":"two_shop/mysql表设计.md","ref":"two_shop/mysql表设计.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"two_shop/go的mysql操作.md","mtime":"2020-05-30T09:22:03.733Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-05-30T14:47:16.991Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

